package com.example.paopao.consumer.job.controller;

import com.example.paopao.common.web.JsonResult;
import com.example.paopao.consumer.job.service.IJobHiringService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/v1/jobs/")
@Api(tags = "招工分页")
public class JobHiringController {

    @Autowired
    private IJobHiringService iJobHiringService;

    @GetMapping("{id}/work")
    public JsonResult listReleaseDistrict(@PathVariable Long id){
        return JsonResult.ok();
    }

    @GetMapping("hiring")
    @ApiOperation("分页")
    public JsonResult listHiring(@RequestParam Integer page){
        Integer pageNum = page;
        if (page == null || page < 1) {
            pageNum = 1;
        }
        return JsonResult.ok( iJobHiringService.listJobHiring(pageNum));
    }


}
